@extends('admin.main')
@section('body')
	<div class="main-title">
		<h2>{{isset($info['pid']) ? '编辑':'新增'}}分类</h2>
	</div>
	<div class="tab-wrap">
		<div class="tab-content">
			<form action="" method="post" class="form-horizontal">
				<!-- 基础 -->
				<div id="tab1" class="tab-pane in tab1">
					<div class="form-item">
						<label class="item-label">上级分类<span class="check-tips"></span></label>
						<div class="controls">
							<input type="text" class="text input-large" disabled="disabled" value="{{isset($category['title']) ? $category['title'] : '无'}}"/>
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">
							分类名称<span class="check-tips">（名称不能为空）</span>
						</label>
						<div class="controls">
							<input type="text" name="title" class="text input-large" value="{{isset($info['title']) ? $info['title'] : ''}}">
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">
							发布内容<span class="check-tips">（是否允许发布内容）</span>
						</label>
						<div class="controls">
							<label class="inline radio"><input type="radio" name="allow_publish" value="0" @if(isset($info['allow_publish']) && $info['allow_publish'] == 0) checked  @endif>不允许</label>
							<label class="inline radio"><input type="radio" name="allow_publish" value="1" @if(!isset($info['allow_publish']) ||  $info['allow_publish'] == 1) checked  @endif>仅允许后台</label>
							<label class="inline radio"><input type="radio" name="allow_publish" value="2" @if(isset($info['allow_publish']) && $info['allow_publish'] == 2) checked  @endif>允许前后台</label>
						</div>
					</div>
				</div>

				{{--<div class="form-item">--}}
					{{--<input type="hidden" name="id" value="{$info.id|default=''}">--}}
					{{--<input type="hidden" name="pid" value="{:isset($category['id'])?$category['id']:$info['pid']}">--}}
					{{--<button type="submit" id="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>--}}
					{{--<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>--}}
				{{--</div>--}}
				<div class="form-item">
					<input type="hidden" name="id" value="{{isset($info['id']) ? $info['id'] : ''}}">
					<input type="hidden" name="pid" value="{{isset($category['id']) ? $category['id'] : $info['pid']}}">
					<button type="submit" id="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
					<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</form>
		</div>
	</div>
@endsection
@section('script')
	<script type="text/javascript">
		$(function(){
			showTab();
			$("input[name=reply]").change(function(){
				var $reply = $(".form-item.reply");
				parseInt(this.value) ? $reply.show() : $reply.hide();
			}).filter(":checked").change();
		});
	</script>
@endsection
